<template>
  <div class="find">
    <!-- 头部 -->
    <van-nav-bar
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
      class="header"
    />
    <!-- 搜索框 -->
    <div class="van-search">
      <router-link class="btn" to="/city">上海</router-link>
      <input class="ipt" type="text" placeholder="请输入校区或地址" />
      <van-icon name="location-o" size="25" />
    </div>
    <!-- 下拉菜单 -->
    <van-dropdown-menu class="menu">
      <van-dropdown-item v-model="value1" :options="option1" />
      <van-dropdown-item v-model="value2" :options="option2" />
      <van-dropdown-item v-model="value3" :options="option3" />
      <van-dropdown-item v-model="value4" :options="option4" />
    </van-dropdown-menu>
  
  </div>
</template>

<script>
export default {
  methods: {
    onClickLeft () {
      this.$router.back()
    }
  },
  data () {
    return {
      value1: 0,
      value2: 'a',
      value3: 'j',
      value4: 'x',
      option1: [
        { text: '区域', value: 0 },
        { text: '新款商品', value: 1 },
        { text: '活动商品', value: 2 }
      ],
      option2: [
        { text: '方式', value: 'a' },
        { text: '不限', value: 'b' },
        { text: '销量排序', value: 'c' }
      ],
      option3: [
        { text: '租金', value: 'j' },
        { text: '新款商品', value: 'k' },
        { text: '活动商品', value: 'l' }
      ],
      option4: [
        { text: '筛选', value: 'x' },
        { text: '新款商品', value: 'y' },
        { text: '活动商品', value: 'z' }
      ]
    }
  }
}
</script>

<style lang="less" scoped>
.find {
  .van-search {
    position: fixed;
    top: 20px;
    z-index: 999;
    margin-left: 40px;
    transform: translateY(-10px);
    width: 300px;
    height: 30px;
    border-radius: 5px;
    .van-icon {
      position: absolute;
      transform: translate(295px);
      color: #fff;
    }
    .btn {
      height: 18px;
      font-size: 12px;
      width: 60px;
      border-radius: 3px;
      color: #333;
      background-color: white;
      border: 1px solid #fff;
      border-right: 1px solid #999999;
    }
    .ipt {
      margin-left: 10px;
      height: 85%;
      border: 1px solid #fff;
      font-size: 12px;
      color: #999999;
    }
  }
}
</style>
